/**
 * Daq Functions Header File
 *
 * Matthew W. Bone 
 */
#ifndef _DAQ_FUNCTIONS_
#define _DAQ_FUNCTIONS_

#include <sys/time.h>
#include "adsend_comedi.h"
#include <comedilib.h>

#define ADSEND_COMEDI_MAX_SAMPLES 50
#define ADSEND_COMEDI_MAX_CHANNELS 64

daq_handle *initialize_daq(ew_adsend_config_file *configfile);

void start_acquisition(daq_handle *handle);

void stop_acquisition(daq_handle *handle);

void get_results(daq_handle *handle, TraceDataQueue *queue);

struct timeval *calculate_starttime(struct timeval *endtime, int num_samples, 
			     long samples_per_second);

struct timeval *calculate_endtime(struct timeval *starttime, int num_samples, 
				  long samples_per_second);

double timeval_to_double(struct timeval *time);
#endif
